package model

import (
	"time"
)

type Category struct {
	ID         uint64    `gorm:"primaryKey;autoIncrement;comment:'分类id'" json:"id"`
	Name       string    `gorm:"type:varchar(60);not null;default:'';unique;comment:'分类名称'" json:"name"`
	CreateTime time.Time `gorm:"type:datetime;not null;default:CURRENT_TIMESTAMP;comment:'创建时间';index:idx_create_time" json:"create_time"`
	UpdateTime time.Time `gorm:"type:datetime;not null;default:CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;comment:'最后一次更新时间'" json:"update_time"`
}

func (Category) TableName() string {
	return "t_category"
}
